<?php
namespace Devcopilot\Models;

use Devcopilot\Models\BaseModel;

class Requirement extends BaseModel
{
    protected $table = 'requirements';

    public function getAll() {
        return $this->newQuery()->getAll();
    }

    public function getCount(string $type) {
        $query = $this->newQuery();
        if($type === 'wait') {
            // 待开发的需求
            $query->whereBySql('req_status IN (?,?)', [2,4]);
        }
        return $query->count();
    }
}